const {fs, path} = require('@vuepress/shared-utils')

module.exports = {
  base: "/coding-interviews/",
  title: 'Coding-Interviews',
  description: '💖Complete solutions to Leetcode problems; updated daily.',
  host: 'localhost',
  port: '9999',
  head: [
    ['link', {rel: 'icon', href: `/offer.svg`}],
    ['link', {rel: 'manifest', href: '/icons/manifest.json'}],
    ['meta', {name: 'theme-color', content: '#ffffff'}],
    ['meta', {name: 'apple-mobile-web-app-capable', content: 'yes'}],
    ['meta', {name: 'apple-mobile-web-app-status-bar-style', content: 'black'}],
    ['link', {rel: 'apple-touch-icon', href: `/icons/apple-touch-icon.png`}],
    ['link', {rel: 'mask-icon', href: '/icons/safari-pinned-tab.svg', color: '#5bbad5'}],
    ['meta', {name: 'msapplication-TileImage', content: '/icons/mstile-144x144.png'}],
    ['meta', {name: 'msapplication-TileColor', content: '#00aba9'}]
  ],
  theme: '@vuepress/vue',
  themeConfig: {
    repo: 'ryanjiena/Coding-Interviews',
    docsDir: 'docs',
    editLinks: true,
    editLinkText: 'Edit this page on GitHub',
    smoothScroll: true,
    lastUpdated: 'Last Updated',
    nav: [
      {text: 'Index', link: '/'},
      {text: 'Coding-Interviews', link: '/src/'},
      {text: 'Blog', link: 'https://ryanjie.gitee.io'},
      {text: 'Bimg', link: 'https://ryanjiena.gitee.io/bimg'},
      {text: 'Leetcode', link: 'https://ryanjiena.gitee.io/leetcode'},
      {text: 'LinuxGuide', link: 'https://ryanjiena.gitee.io/linuxguide'},
      {text: 'Gitee', link: 'https://gitee.com/ryanjiena/Coding-Interviews'}
    ],
    algolia: {
      apiKey: '609a86c98671a264b774c41c67873899',
      indexName: 'bimg'
    },
    sidebar: {
      '/src/': getSrcSidebar('数组', '字符串', '链表', '树', '栈和队列', '查找和排序', '递归和循环', '位运算', '代码的完整性', '代码的鲁棒性', '面试思路', '综合', '回溯法', '其它')    
    }
  },
  plugins: [
    ['@vuepress/active-header-links', {
      sidebarLinkSelector: '.sidebar-link',
      headerAnchorSelector: '.header-anchor'
    }],
    ['@vuepress/back-to-top', true],
    ['@vuepress/last-updated'],
    ['@vuepress/medium-zoom', true],
    ['@vuepress/nprogress'],
    ['@vuepress/pwa', {
      serviceWorker: true,
      updatePopup: true
    }],
    ['@vuepress/search', {
      searchMaxSuggestions: 20
    }],
    ['sitemap', {
      hostname: 'https://ryanjiena.gitee.io/coding-interviews'
    }],
    ['img-lazy'],
    ['vuepress-plugin-code-copy', true]
  ]
}

function getSrcSidebar(groupA, groupB, groupC, groupD, groupE, groupF, groupG, groupH, groupI, groupJ, groupK, groupL, groupM, groupN) {
  return [
    {
      title: groupA,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupB,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupC,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupD,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupE,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupF,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupG,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupH,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupI,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupJ,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupK,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupL,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupM,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    },
    {
      title: groupN,
      collapsable: false,
      sidebarDepth: 2,
      children: [
        '003-Duplicate-Number-In-Array'
      ]
    }
  ]
}